<?php 
global $_W,$_GPC;
include MODULE_ROOT.'/inc/mobile/__init.php';
$id = intval($_GPC['id']);

$title = "我的收货码";

$sql = "SELECT * FROM ".tablename('imeepos_runner3_tasks')." WHERE id = :id";
$params = array(':id'=>$id);
$tasks = pdo_fetch($sql,$params);

$qrcode = $tasks['qrcode'];
$code = $tasks['code'];

//$recive

$act = trim($_GPC['act']);
if($act == 'getqr'){
	$params = $qrcode;
	if(!empty($params)) {
		include IA_ROOT . '/framework/library/qrcode/phpqrcode.php';
		QRcode::png($params, false, QR_ECLEVEL_Q, 4);
	}
	die();
}

$qr_url = $this->createMobileUrl('manage_qr',array('id'=>$id,'act'=>'getqr'));

$_pjax = trim($_GPC['_pjax']);

$template_content = $template.'/qrcode/qrcode';

if($_W['isajax']){
	include $this->template($template_content,TEMPLATE_FETCH);
}else{
	include $this->template($template.'/index');
}